#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include<QLabel>
#include<QHBoxLayout>
#include<QVBoxLayout>
#include<QPushButton>
#include <QSpinBox>
#include <QDialog>
#include <QTextEdit>
#include <QTcpSocket>
#include <QPlainTextEdit>
#include <QHostAddress>

#include"deck.h"
#include"player.h"
#include"hand.h"
#include"card.h"

class Deck;

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
     Widget(QWidget *parent = 0);
    ~Widget();
     void createShuffledarr(int arr[15]);
     void start_chip();

public:

     QLabel * l_player[6];
     QLabel * w_abandon;
     QLabel * w_public;

     QVBoxLayout * VLayou1;
     QVBoxLayout * VLayou2;
     QVBoxLayout * VLayou3;
     QVBoxLayout * VLayou4;
     QVBoxLayout * VLayou5;

     QVBoxLayout * VLayou01;

     QPushButton * pushbtn;
     QPushButton * btn_show;
     QPushButton * btn_change;
     QPushButton * btn_check;
     QPushButton * btn_reject;
     QPushButton * btn_pub;
     QPushButton * btn_raise;
     QPushButton * btn_call;
     QPushButton * btn_fold;
     QPushButton * btn_all;

     QPushButton * btn_start;
     QPushButton * btn_tcps;

     QHBoxLayout * HLayou;
     QHBoxLayout * HLayou_01;
     QHBoxLayout * HLayou_02;
     QHBoxLayout * HLayou_03;
     QHBoxLayout * HLayou_04;

     QLabel * lab_1 ;
     QLabel * lab_2 ;

     QTextEdit * w_ip;
     QTextEdit * w_port;

     QPlainTextEdit * w_record;
     QPlainTextEdit * record;

     QSpinBox * spin_raise;

     QString txt[6];


signals:
     void gamestart();
     void kaishi();
     void change();
     void cchange();
     void chips();

private:
    Ui::Widget *ui;

    int Shuffled[15];//洗牌数组

    Card * w_card[15];
    Hand * w_hand[6];
    Player * w_plyr[6];
    Deck * w_deck;

    QTcpSocket * m_tcp;

    QWidget * newidget;

private slots:
    void game_start();
    void show_card(int winner);
    void if_change();
    void c_change();
    void r_change();
    void if_pub();
    void w_raise();
    void w_fold();
    void w_call();
    void w_all();
    void connect_tcp();
    void analyze();
    void start_game();
    void if_me();
    void if_mechip();//是不是到我下注

};


#endif // WIDGET_H
